<%@ Page Language="C#" AutoEventWireup="true" Inherits="Syrinx.Gui.AspNet.Ajax.NitobiBasePage" 
	 MasterPageFile="~/App_ThemeMasters/NoStyle/popUpTwoColumnLayout.Master" %>
<%@ Register Assembly="Swaf.Gui.AspNet2" Namespace="Swaf.Gui.AspNet2" TagPrefix="swf" %>
<%@ Register Assembly="ScsAspNet" Namespace="Syrinx.Gui.AspNet.Ajax" TagPrefix="saj" %><%@ Register Assembly="NitobiControls" Namespace="Nitobi" TagPrefix="ntb" %>

<asp:Content ContentPlaceHolderID="title" ID="c01" runat="server">
 <div class="left"><h1><asp:Label ID="ImgCacheLibLbl" runat="server" > Image Cache Library</asp:Label></h1></div>
<swf:BizProc ID="settings" runat="server" FactoryName="mediaCache">
</swf:BizProc>

 <swf:BizProc runat="server" ID="adl" factoryName="mediaDirectoryLibrary">
	<State entireTree="false" EditModeSessionKey="GlobalEdit" includeSelf="true" />
	<ParentBizProc id="settings" fieldName="id" dataId="pid" />
</swf:BizProc>
<swf:BizProc runat="server" ID="ail" FactoryName="mediaImagesLibrary">
	<ParentBizProc id="adl" fieldName="keyName" dataId="pid" />
	<ParentBizProc id="settings" fieldName="id" dataId="cid" />
</swf:BizProc>
<script type="text/javascript">
function toggleTabs(cId,c1, dId){
	for(i=1; ;i++){
		var a = document.getElementById(cId + i);
		var b = document.getElementById(dId + i);
		if(a==null || a=='')
			break;
			
		if(i==c1){
			a.className = 'currenttab';
			b.style.display = 'block';
		}
		else{
			a.className='';
			b.style.display = 'none';
		}
	}
}
</script>
</asp:Content>

<asp:Content ContentPlaceHolderID="leftContent" ID="c02" runat="server">
	<asp:Label runat="server" ID="cachlistLbl" Text="Company Image Caches:" />
	<saj:Combo ID="caches" runat="server" ParentBizProcIds="settings" DataTextField="name" DataValueField="id">
		<Columns>
			<ntb:BoundColumn DataField="id" Visible="false" />
			<ntb:BoundColumn DataField="name" HeaderText="Name" width="200" />
		</Columns>
	</saj:Combo>
	<saj:Grid ID="articleList1Display" runat="server" Width="273px" Height="425px" Resizable="Both" ShowToolbar="false" ParentBizProcIds="adl" Mode="LiveScrolling">
		<Columns>
			<ntb:KeyColumn DataField="keyName"  />
			<ntb:BoundColumn DataField="depthName" HeaderText="Name" width="200" />
			<ntb:NumberColumn DataField="fileCount" HeaderText="Num Files" width="56" Mask="#,###" />
			<ntb:BoundColumn DataField="xx" Width="40" />
		</Columns>
	</saj:Grid>
	
	<swf:BizProc runat="server" ID="ap" FactoryName="actionParam">
		<ParentBizProc id="ail" fieldName="name" dataId="pid" />
	</swf:BizProc>
		
</asp:Content>
<asp:Content ContentPlaceHolderID="rightContent" ID="c03" runat="server">
	<div class="tabs">
		<ul>
			<li id="t1" class="currenttab"><div class="firstTab"><swf:DivLayers runat="server" ID="tl1" SkinID="Tab"><asp:HyperLink onclick="toggleTabs('t','1','ta');" runat="server" ID="_cmpMngrTab1" Text="Images" NavigateUrl="javascript:;" /></swf:DivLayers></div></li>
			<li id="t2"><swf:DivLayers runat="server" ID="tl2" SkinID="Tab"><asp:HyperLink runat="server" onclick="toggleTabs('t','2','ta');" ID="_pubInfLbl" Text="Upload" NavigateUrl="javascript:;" /></swf:DivLayers></li>
			<li id="t3"><div class="lastTab"><swf:DivLayers runat="server" ID="tl3" SkinID="Tab"><asp:HyperLink runat="server" onclick="toggleTabs('t','3','ta');" ID="_cmpMngrTab3" Text="Directory Info" NavigateUrl="javascript:;" /></swf:DivLayers></div></li>
		</ul>
	</div>
	<swf:DivLayers ID="mdl1" runat="server" SkinID="MainTabArea">
		<div id="ta1">
	        <saj:ComplexBizObjListDisplay runat="server" ID="miImages" 
		        ReadOnlyTemplate="MediaCache.Gui.AspNet.ImagesListDisplay-ServerButton" 
		        ParentBizProcIds="ail">
		        <macros>
			        <Entry name="navLink" type="String">imageviewer.aspx</Entry>
		        </macros>
	        </saj:ComplexBizObjListDisplay>
		</div>
		<div id="ta2" style="display:none;">
		    <iframe width="400" height="300" src="ImageUploadPopupChild.aspx" frameborder="no" scrolling="auto">
		    </iframe>
		</div>

		<div id="ta3" style="display:none;">
			<span class="button1"><saj:ActionButton runat="server" ID="_mdb1" Actions="adl.AddBizObj" Text="Add" /></span>
			<span class="button6"><saj:ActionButton runat="server" ID="_mdb2" Actions="adl.UpdateBizObj" Text="Update" /></span>
			<span class="button1"><saj:ActionButton runat="server" ID="_mdb3" Actions="adl.CancelEdits" Text="Cancel" /></span>
			<span class="button5"><saj:ActionButton runat="server" ID="_mdb4" Actions="adl.DeleteBizObj" Text="Delete" ClientClick="if(!confirm('Are you sure you want to delete?'))return false;"/></span>

			<saj:NitobiBizObjDisplay ID="mdd1" runat="server" ParentBizProcIds="adl"
				ReadOnlyTemplate="MediaCache.Gui.AspNet.MediaDirectoryDetailsDisplay" />
		</div>
	</swf:DivLayers>
</asp:Content>
<asp:Content ContentPlaceHolderID="buttons" ID="c04" runat="server">
	<div style="float:left;">
		<saj:ActionButton runat="server" ID="updateBtn" Actions="ap.UpdateBizObj" Text="Save Selected" 
			AfterClientClick="window.returnValue = true;window.close();return false;" />
	</div>
</asp:Content>

